package net.entelijan.cobean.examples.showcase.filesel;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;

import net.entelijan.cobean.examples.util.ExamplesUtil;
import net.entelijan.scf.DefaultShowcasePanel;
import net.miginfocom.swing.MigLayout;

public class FileselPanel extends DefaultShowcasePanel {

	private static final long serialVersionUID = 1L;

	private JComboBox dirComboBox = new JComboBox();
	private JButton dirSelButton = new JButton("...");
	private JComboBox fileComboBox = new JComboBox();
	private JButton fileSelButton = new JButton("...");
	private JComboBox txtFileComboBox = new JComboBox();
	private JButton txtFileSelButton = new JButton("...");

	private JButton showSelectionButton = new JButton("Show Selections");
	private JButton selectHomeButton = new JButton("Select $HOME");

	public FileselPanel() {
		super();
		this.setLayout(new MigLayout());

		this.add(new JPanel(), "height 0:50:max, wrap");
		this.add(new JLabel("Select a directory"), "span 2, wrap");
		this.add(this.dirComboBox, "w 100:max:max");
		this.add(this.dirSelButton, "wrap");

		this.add(new JPanel(), "height 10:50:max, wrap");
		this.add(new JLabel("Select a file"), "span 2, wrap");
		this.add(this.fileComboBox, "w 100:max:max");
		this.add(this.fileSelButton, "wrap");

		this.add(new JPanel(), "height 10:50:max, wrap");
		this.add(new JLabel("Select a text file (*.txt)"), "span 2, wrap");
		this.add(this.txtFileComboBox, "w 100:max:max");
		this.add(this.txtFileSelButton, "wrap");

		this.add(new JPanel(), "height max, grow, wrap");
		this.add(ExamplesUtil.createButtonsPanel(100, this.showSelectionButton,
				this.selectHomeButton), "w max");

	}

	public JComboBox getDirComboBox() {
		return dirComboBox;
	}

	public void setDirComboBox(JComboBox dirComboBox) {
		this.dirComboBox = dirComboBox;
	}

	public JButton getDirSelButton() {
		return dirSelButton;
	}

	public void setDirSelButton(JButton dirSelButton) {
		this.dirSelButton = dirSelButton;
	}

	public JComboBox getFileComboBox() {
		return fileComboBox;
	}

	public void setFileComboBox(JComboBox fileComboBox) {
		this.fileComboBox = fileComboBox;
	}

	public JButton getFileSelButton() {
		return fileSelButton;
	}

	public void setFileSelButton(JButton fileSelButton) {
		this.fileSelButton = fileSelButton;
	}

	public JComboBox getTxtFileComboBox() {
		return txtFileComboBox;
	}

	public void setTxtFileComboBox(JComboBox txtFileComboBox) {
		this.txtFileComboBox = txtFileComboBox;
	}

	public JButton getTxtFileSelButton() {
		return txtFileSelButton;
	}

	public void setTxtFileSelButton(JButton txtFileSelButton) {
		this.txtFileSelButton = txtFileSelButton;
	}

	public JButton getShowSelectionButton() {
		return showSelectionButton;
	}

	public void setShowSelectionButton(JButton showSelectionButton) {
		this.showSelectionButton = showSelectionButton;
	}

	public JButton getSelectHomeButton() {
		return selectHomeButton;
	}

	public void setSelectHomeButton(JButton selectHomeButton) {
		this.selectHomeButton = selectHomeButton;
	}

}
